import request from '@/utils/request'

export function login(data) {
  console.log(data);
  return request({
    url: '/user/login',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: '/user/getUserInfo',
    method: 'get',
    params: { token }
  })
}
export function register(data) {
  return request({
    url: '/user/register',
    method: 'post',
    data
  })
}
export  function getUserList() {
  return request({
    url: '/user/getUserList',
    method: 'get',
  })
}
export  function deleteUser(id) {
  return request({
    url: `/user/deleteUser/${id}`,
    method: 'delete',
  })
}
export  function updateUserInfo(data) {
  return request({
    url: `/user/updateUserInfo`,
    method: 'put',
    data
  })
}
export  function updatePassword(data) {
  return request({
    url: `/user/updatePassword`,
    method: 'put',
    data
  })
}


